package com.lagou.client;

import com.lagou.client.ClientScanner;
import com.lagou.model.Student;

import java.util.ArrayList;

public class ClientStudentModule {


    public Student add() {

        System.out.println("请输入学生的名字");
        String name = ClientScanner.getScanner().next();
        System.out.println("请输入学生的密码");
        String pwd = ClientScanner.getScanner().next();
        System.out.println("请输入学生的id");
        int id = ClientScanner.getScanner().nextInt();
        System.out.println("请输入学生的专业");
        String major = ClientScanner.getScanner().next();
        return    new Student(name, pwd, id, major);

    }

    public Student delete() {
        System.out.println("请输入要删除该学生的学号");
        int id = ClientScanner.getScanner().nextInt();
        Student s = new Student();
        s.setId(id);
        return s;
    }

    public Student findOF() {
        System.out.println("请输入要查询该学生的学号");
        int id = ClientScanner.getScanner().nextInt();
        Student s = new Student();
        s.setId(id);
        return s;
    }

    public Student update() {
        System.out.println("请要修改学生的学号");
        int id = ClientScanner.getScanner().nextInt();
        System.out.println("请修改以下信息");
        System.out.println("请输入学生的名字");
        String name = ClientScanner.getScanner().next();
        System.out.println("请输入学生的密码");
        String pwd = ClientScanner.getScanner().next();
        System.out.println("请输入学生的专业");
        String major = ClientScanner.getScanner().next();
        return new Student(name, pwd, id, major);
    }
    public Student updatePWD() {
        System.out.println("请输入你的学号");
        int id = ClientScanner.getScanner().nextInt();
        System.out.println("请输入你要修改的密码");
        String pwd = ClientScanner.getScanner().next();
        return new Student(id, pwd);
    }

}
